There are system streams prescribed by the MPEG2 standard (ISO/IEC 13818-1) as methods of compressing video signals at low bit rates. As such system streams, three kinds are prescribed: Program Stream, Transport Stream and PES (Packetized Elementary Stream).
On the other hand, as recording media to be substituted for magnetic tapes, public attention has been drawn to optical discs such as phase change optical discs (for example, DVD-RAM and MVDISC) and magneto-optical discs (MO). An example of standards for video recording on DVD-RAMs is Video Recording standard (DVD Specifications for Rewritable/Re-recordable Discs Part 3 Video Recording Version 1.0 September 1999).
Further, there is also a case where a moving picture file composed of an MPEG2 transport stream prescribed by ISO/IEC 13818-1 is recorded and reproduced with respect to a phase change optical disc. In this case, video data are compressed by the MPEG2 prescribed in ISO/IEC 13818-2, and audio data are compressed, e.g., by the MPEG2-AAC (Advanced Audio Coding) prescribed in ISO/IEC 13818-7.
FIG. 6 shows a block diagram of a conventional real-time recording and reproduction apparatus 300 for a transport stream, using a phase change optical disc. In FIG. 6, when recording video signals and audio signals, signals input from a video signal input section 100 and an audio signal input section 102 are compressed by a video compression section 101 and an audio compression section 103, respectively. Thereafter, a transport stream is generated at a system encoder section 104, and is written to a phase change optical disc 131 via a recording section 120 and a pickup 130. Here, the video compression section 101, the audio compression section 103 and the system encoder section 104 constitute an MPEG encoder 170.
When reproducing the video signals and the audio signals, a transport stream taken out via the pickup 130 and a reproduction section 121 is separated by a system decoder section 114 into video signals and audio signals, which are output to a video display section 110 and an audio output section 112 via a video decoding section 111 and an audio decoding section 113, respectively. Here, the video decoding section 111, the audio decoding section 113 and the system decoder section 114 constitute an MPEG decoder 171.
When recording the video signals and the audio signals, a recording control section 161 controls the recording section 120, a contiguous data area detection section 160 and a logical block management section 163, thereby performing the recording. At this time, the contiguous data area detection section 160 checks the utilization status of sectors managed by the logical block management section 163 according to instructions from the recording control section 161, thereby detecting a physically contiguous space area. When the recording is completed, a moving picture file composed of a transport bit stream is created.
When reproducing the video signals and the audio signals, a reproduction control section 162 controls the reproduction section 121, thereby performing the reproduction.
Further, an editing control section 164 is activated when performing an editing process, e.g., of deleting a portion of the moving picture file containing the recorded video signals and audio signals.
FIG. 7 is a diagram showing a recording format in the case of real-time video recording on the phase change optical disc 131. In FIG. 7, the phase change optical disc 131 is comprised of 2 Kbyte sectors, wherein 16 sectors are treated as one logical block (32 Kbytes), and an error-correcting code is provided to each of the logical blocks for recording on the phase change optical disc 131.
Furthermore, a physically contiguous logical block having a data size corresponding to at least a predetermined time period (for example, data corresponding to 0.5 second at a maximum read-in rate) is reserved as one contiguous data area. Onto this area, Movie Object Units (hereinafter referred to as MOBUs), each of which is a unit video packet composed of an MPEG transport stream corresponding to 0.4 to 1 second, are recorded sequentially.
One MOBU is composed of transport packets that are in units of 188 bytes and are at a lower hierarchy level than the MPEG transport stream. The transport packets include four kinds: Video Transport Packet (V_TSP) for storing compressed video data; Audio Transport Packet (A_TSP) for storing compressed audio data); Program Association Table Transport Packet (PAT_TSP); and Program Map Table Transport Packet (PMT_TSP).
Further, one MOBU contains all the V_TSPs for a corresponding time. Moreover, one MOBU contains all the A_TSPs containing audio frames that are needed in timing for fulfilling a T-STD (Transport Stream System Target Decoder). That is to say, the audio frames are completed in the MOBU. Further, if the video is of a variable bit rate, the data size of one MOBU varies in a range not higher than a maximum recording/reproduction rate. On the other hand, if the video is of a fixed bit rate, the data size of the MOBU is substantially constant.
FIG. 8 is a diagram showing details of the V_TSP, the A_TSP, the PAT_TSP and the PMT_TSP. As shown in FIG. 8, the V_TSP is composed of a transport packet header and video data. The A_TSP is composed of a transport packet header and audio data. The PAT_TSP is composed mainly of a transport packet header and a program association table. The PMT_TSP is composed mainly of a transport packet header and a program map table.
The four elements, V_TSP, A_TSP, PAT_TSP and PMT_TSP, are identified by PIDs (Packet IDs) in the transport packet headers. For example, as shown in FIG. 8, the V_TSP, the A_TSP, the PAT_TSP and the PMT_TSP are identified by detecting PID=“0x0020”, PID=“0x0021”, PID=“1x0000” and PID=“0x0030”, respectively.
Here, the PID allocation statuses for the V_TSP and the A_TSP are recorded in the program map table in the PMT_TSP. Besides, the PID for the PAT_TSP has a fixed value of “1x0000”.
At the time a residual portion of one contiguous data area becomes small, the contiguous data area detection section 160 shown in FIG. 6 detects a subsequent contiguous data area again. When the one contiguous data area becomes full, the writing to the subsequent data area is performed.
Further, FIG. 9 shows an example of a state where recorded contents on an optical disc are managed by a FAT (File Allocation Table) file system. Here, the cluster of the FAT file system corresponds to the logical block of FIG. 7, and its data size is assumed to be 32 Kbytes. FIG. 9 shows the case in which one MPEG transport stream is recorded, as a moving picture file “movie000.m2t”, by one operation of a record starting button for each ON and OFF.
As shown in FIG. 9, a file name and a starting cluster number of the data in the file are stored in a directory entry. Further, the FAT manages, in units of clusters, storage addresses of the data in the file. For example, an address in the FAT corresponding to one cluster number holds a cluster number of the next storage address. By such directory entry and FAT, one file and three contiguous data areas a, h and c constituting the file are managed. Note here that the name portion (m2t) of the extension in the file name shown in FIG. 9 and the other name portion (movie 000) are recorded in separate fields in the directory entry, but are not distinguished for simplifying the description.
Furthermore, the data size of each contiguous data area a and b needs to be an integral multiple of the data size (32 Kbytes) of one logical block (cluster). Besides, the data size of the contiguous data area c may be an arbitrary data size.
The process in which the contiguous data area is separated into three pieces as above will be described. Firstly, when the recording control section 161 finds a defective logical block during recording onto the contiguous data area a, it skips such defective logical block, and continues the writing process from the head of the contiguous data area b.
Further, when the recording control section 161 detects, during recording onto the contiguous data area b, that a need of recording onto a record area of a PC file has arisen, it skips the record area of the PC file this time, and continues the writing process from the head of the contiguous data area c. As a result, the file “movie000.m2t” is constituted by the three contiguous data areas a, b and c.
FIG. 10 is a diagram showing a data structure of a video file after editing. As shown in FIG. 10, in the case where a mid-stream of the file is deleted, the file, after editing, is constituted by a data stream A positioned before the deleted portion, a data stream B positioned after the deleted portion, and padding. The data size of the padding is 1.504 Mbytes at maximum (752 Kbytes on average). This maximum value is the least common multiple of 188 bytes, which is the data size of the transport packet, and 32 Kbytes, which is the data size of the logical block.
Here, the padding was assumed to be of null transport packets (packets of PID=1FFFh), but may also be packets having other PIDs.
As shown in FIG. 10, in the case where a mid-stream of a moving picture file is partially deleted, and the remaining portions are combined into one as one moving picture file, a prior art method has a problem that the amount of padding becomes very large when attempting to maintain continuity of packets constituting the file.